<include file="Common/header" />
<link rel="stylesheet" href="__COMPATH__/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
 
<title>内容管理</title>
</head>
<body class="pos-r">
<div class="pos-a" style="width:180px;left:0;top:0; bottom:0; height:100%; overflow:hidden; border-right:1px solid #e5e5e5; background-color:#f5f5f5">
	<ul id="treeDemo" class="ztree">
	</ul>
</div>
<div style="margin-left:180px; ">
 
 <iframe scrolling="yes" name="right" id="Contentlist" frameborder="0" src="{:U('Index/welcome')}" style="width:100%;height:500px; border:none" frameborder="0" scrolling="auto"></iframe>
    
</div>
<script type="text/javascript" src="__COMPATH__/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script> 
 
 
 <script type="text/javascript">
var setting = {
	view: {
		dblClickExpand: false,
		showLine: true,
		selectedMulti: false
	},
	data: {
		simpleData: {
			enable:true,
			idKey: "id",
			pIdKey: "pId",
			rootPId: ""
		}
	},
	callback: {
		onClick: onClick
	 
	} 
};
function onClick(e,treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");
			zTree.expandNode(treeNode);
		}

var zNodes =[
<volist name="catelist" id="vo">
<if condition="$vo['cont'] eq 1">
	{ id:{$vo.catid}, pId:{$vo.parentid}, name:"{$vo.catname}",target:'right'<if condition="$i eq 1">, open:true</if>},   

<else />
	{ id:{$vo.catid}, pId:{$vo.parentid}, name:"{$vo.catname}",url:"{:U('Content/lists',array('catid'=>$vo['catid']))}",target:'right'<if condition="$i eq 1">, open:true</if>}, 

</if>
</volist> 	
];
		
 	
$(document).ready(function(){
	$('#Contentlist').height($('body').height()-10);
	var t = $("#treeDemo");
	t = $.fn.zTree.init(t, setting, zNodes);
	demoIframe = $("#testIframe");
	demoIframe.bind("load", loadReady);
	var zTree = $.fn.zTree.getZTreeObj("tree");
	zTree.selectNode(zTree.getNodeByParam("id",'11'));
});
 
 
 </script>
</body>
</html>